Part Number Hot Search : 
XQ18V04 LB186209 AN7710SP STA371A 4HC40 1N5335BG 50009 AD9142
Product Description
Full Text Search
 

To Download AN1291 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  author: m. di guardo, v. marino AN1291 application note ? slip control of an asynchronous three-phase motor with st52x420 1/33 july 2000 1. introduction induction motors with squirrel-cage rotors are the workhorse of industry because of their low cost and rug- ged construction. the aim of this application note is to show how to perform the slip control of an ac three- phase induction motor with st52x420, in order to obtain minimum input power and maximum efficiency operations. this type of control can be achieved by adjusting the amplitude of the applied stator voltage versus torque requirement. efficiency improvement by voltage control is obtained by reducing the applied voltage when- ever the torque requirement of the load can be met with less flux. the reduced motor flux results in a reduction of core and stator copper losses since the magnetization component of the stator current is reduced as well. however, it is to note that the minimization of the air gap flux requires a larger slip to produce the torque required if compared with operations at full rated flux. this application note shows the implementation of the slip control of an aynchronous motor in order to have energy saving of the global power system, representing a convenient solution to reduce the rotor and stator copper losses. 1.1 torque characteristics of asynchronous three-phase motors typical torque and current characteristics are represented in figure 1 where the torque t em is plotted as function of rotor speed and f sl (slip frequency is the difference between stator frequency f and rotor fre- quency). at low values of f sl ,t em varies linearly with f sl ,see the line plotted in bold in the stable zone (fig.1). the maximum torque that the motor can produce is represented by the pull-out point shown below. figure 1. torque versus rotor speed at f and vs constant. pull-out torque flux decreases t, rated 1.5 1.0 flux =rated rated 1.0 0.2 0.4 0.6 0.8 0 1.0f 0.8f 0.6f 0.4f 0.2f 0 1.0 0.8 0.6 0.4 0.2 0 fsl s slip slip frequency ( f-fr) unstable points stable zone rotor speed maximum torque tem/trated w r w s
AN1291 - application note 2/33 if an induction motor is started directly from the power supply and the load torque is lower than the start- up torque, at maximum slip (slip=1), the motor is able to run and enter in the stable zone. then the inter- section of the motor torque characteristic with load torque determines the steady-state point of operation. if the load torque reaches the maximum torque, the motor enters in the break down domain until the com- plete stop of the motor. 1.2 speed control speed can be controlled by varying stator frequency f with power electronic inverter, in order to control synchronous speed and, hence, the motor speed, if the slip is kept small, keeping the flux constant in the air gap, varying stator voltage in linear proportion to stator frequency f (fig. 2). figure 2. speed control by varying stator frequency the torque speed characteristics shift horizontally in parallel, as shown in figure 2 for four different values of f sl . note that, at a constant load-torque, the slip frequency (which is the frequency of the induced voltage and currents in the rotor circuit in hertz) is constant. 1.3 v/f = constant speed control the simplest method of control is to maintain constant the flux (v/f) with power converters varying the motor speed. this regulation is called torque constant control. if we change the frequency also the voltage applied must vary in a linear way in order to maintain v/f constant. this ratio is dimensionally a flux (fig.3). figure 3. voltage vs frequency relation t, rated 1.5 1.0 ra te d 1.0 0 fs l3 r otor speed increases at the increasing of the stator frequency 1.0 1.0 f1 f2 f3 f4 fs l4 fs l1 fs l2 tem, t rated w r w s vs f vmax vmin f = constant minimum frequency rated frequency (stator frequency)
3/33 AN1291 - application note v/f characteristics are listed below: ? it operates at constant flux and torque ? motor always supplies the maximum torque ? efficiency is not optimized ? motor is oversized in this application note, the flux minimization control has been implemented instead of the v/f constant method. in this way, it is possible to reach good efficiency and torque regulation. 1.4 motor efficiency optimization with slip control the motor efficiency can be improved by controlling the stator voltage to maintain the slip constant at min- imum flux (flux minimization). adapting the flux in the air gap to have a large slip, but not large enough to reach the pull out torque otherwise the motor would stop, the required torque is generated so as to be compared with operation at full rated flux. power loss can be minimized maintaining large and constant the slip adjusting the available torque (fig.4). this voltage varying method of the phase motor offers limited possibilities of speed regulation. however, combining both voltage control (minimum flux) and frequency control, the motor is well controlled in a wide range of speed. figure 4. motor characteristics fixing the stator voltage t,rated 1.5 1.0 rated curve 1.0 0.2 0.4 0.6 0.8 0 1.0f 0.8f 0.6f 0.4f 0.2f 0 1.0 0.8 0.6 0.4 0.2 0 fsl s slip slip frequency f-fr t6 t5 t4 t3 t2 t1 f=constant slip=constant adjusting stator voltage 0 working zone flux =rated tem trated w r w s
AN1291 - application note 4/33 2. control structure the aim of the control is to bring the speed of the motor axis to the reference speed maintaining the slip within a certain range fixed by the measures carried out during the modellization phase of the motor. two fuzzy loops are implemented (fig.5 and 6): figure 5. control structure the first fuzzy loop (fuzzy1) is of the incremental type. the input of this fuzzy block is the speed error given by the difference between the reference speed read through the a/d converter and the motor speed a frotor o calculated using the external interrupt input where the encoder signal is connected. the output of the block d f is summed algebraically to the stator frequency fstator to reach the motor speed to the ref- erence set up. the second fuzzy loop (fuzzy2) receives in input the difference between a fstator o and a frotor o (slip), and adjusts the voltage level ( voltage ) to optimize the flux and prevent overcurrents in the motor (fig. 5 and 6). according to the stator frequency and the desired voltage level, the a pulse generator o block generates three pwm signals to drive the inverter (refer to a pulse construction o for further information). figure 6. fuzzy control diagram encoder external interrupt (rotor period calcolation) rotor frequency fuzzy 1 fuzzy 2 a/d pulse generation pwm0 pwm1 pwm2 reference voltage stator frequency st52x420 speed setpoint speed error rotor speed - fuzzy algorithm d f + - stator frequency increment slip v s stator voltage fuzzy algorithm stator speed rotor speed
5/33 AN1291 - application note 2.1 fuzzy controller algorithm stator voltage loop the st52x420 microcontroller thanks to its fuzzy logic dedicated architecture, allows the implementation of complex systems such as three-phase motors. thanks to the three timers and to the multiplication and division functions it is possible to obtain the three pwm sinusoidal modulation signals to be supplied to the inverter driver varying, in an independent way, the frequency and the modulation index. from a set of preliminary measurements performed on the motor it is possible to build a table that de- scribes the complete functionment of the motor at low and full load in every condition: more precisely, using the electronic system: once the tables have been completed with all the working points we know exactly how to change the stator voltage. implementing a fuzzy logic interpolation we can modify the voltage by using two membership functions inputs that are respectively stator frequency f and slip frequency, using a set of rules of the kind: if frequency is low and slip is very high then output is high more precisely, the output of this function, i.e. a function of two variables: vs=vs(f,s) that is the required voltage for the motor. now, if the loading conditions of the motor are such that the voltage controller is not able to set the motor at the established slip and speed set points, for example under a great increase of the torque in the axis of the motor, then the second controller is activated for the frequency adjustment. figure 7. fuzzy logic voltage control surface rotor frequency [rpm] accuracy [%] stator frequency [hz] max slip frequency (f-fr) [hz] minimum stator voltage [vs] max stator voltage [v] max slip [s%] stator period [msec] tacho period [msec] tacho timer value obtained [byte] max stator timer value [byte] min stator timer value [byte] max slip frequency [byte] fuzzy output (stator voltage) stator frequency s1 f1 slip frequency (f-fr)
AN1291 - application note 6/33 2.2 fuzzy controller algorithm stator frequency loop analogously, to build the fuzzy rule for the stator frequency adjustment, we can take into account the speed error to obtain the right increment or decrement for the frequency adjustment. these rules will be of the kind: if speed error is negative big and then output is negative big more in details, the stator frequency f is equal to: f (k) =f (k-1) d f where d f is the increment or the decrement provided to the output of the fuzzy controller in order to adjust the rotor speed (fig.8). figure 8. fuzzy logic frequency adjustment 2.3 sinewaves pwm modulation for pulse construction, a 24-byte table, representing the unit sinusoid sampling, is allocated in the internal memory of the mcu. the three sinewaves are drawn by the same table using three 120 o -shifted pointers (fig.9). figure 9. pulses construction speed error stator frequency adjustment fuzzy rules 023 0 127 255 k v k the three pointers with 1200 phase shift give the values to be loaded in the pwms pwm 0 pwm 1 pwm 2 va k =1/128*voltage*sin( w t k ) vb k =1/128*voltage*sin( w t k -2/3 p ) vc k =1/128*voltage*sin( w t k -2/3 p ) t k+1 -t k =t*16 m s stator speed by varying reading patterns 10.8hz f 65.1hz 40 t 240 f=1/[24*(t k+1 -t k )] voltage frequency
7/33 AN1291 - application note the pwm sinusoidal modulation is obtained scanning the 24 samples with a variable period related to the frequency to be assigned to the motor phases. each sample is multiplied by the modulation index to change the sinewave amplitude. this is obtained loading this value on the pwm counter thus obtaining a duty-cycle variable that allows to build a sinusoid with an amplitude dependent on the modulation index (fig.10). figure 10. pwm pulses construction 23 0 127 255 k v k t 0 t 1 x t 0 t 1 d 1 d 2 t t modulation index pwm
AN1291 - application note 8/33 3. hardware implementation this application consists of four functional blocks (fig.11): ? a three-phase asynchronous motor ? a three-phase power inverter ? the closed loop fuzzy motor control with st52x420 ? an ac-dc converted supplied by the mains figure 11. three-phase inverter three phase inverter st52x420 microcontroller ac/dc converter feedback encoder
9/33 AN1291 - application note 3.1 motor interface the motor interface consists of three inverter legs with igbt or power mos, which are driven by the st l6386 drive (fig.12). figure 12. dc-ac inverter schematic this structure needs dc link voltage +hv, typical value is 325v rectifying ac line voltage. the three-phase motor is connected in the points named r, s, t. note: * the pcb can be found on the st52 microcontrollers pages at www.st.com/stonline/prodpres/ +15v +15v +15v +15v +15v bus+ bus- + c9 22uf + c11 22uf + c10 22uf r9 100k u1 l6386 4 3 2 1 7 6 13 12 9 8 5 14 vcc hin sd lin sgnd cin hvg out lvg pgnd diag vboot r5 220k r12 c1 .1uf r1 100 j1 phase1 1 j4 bus- 1 j5 bus+ 1 j2 phase2 1 j6 ext.interface 1 2 3 4 5 6 7 8 j3 phase3 1 q1 gp7nb60hdfp c12 220pf q4 gp7nb60hdfp r6 100 c7 3.3nf-1kv r2 8.2k c2 .1uf q5 gp7nb60hdfp q2 gp7nb60hdfp u2 l6386 4 3 2 1 7 6 13 12 9 8 5 14 vcc hin sd lin sgnd cin hvg out lvg pgnd diag vboot r7 100 q6 gp7nb60hdfp u3 l6386 4 3 2 1 7 6 13 12 9 8 5 14 vcc hin sd lin sgnd cin hvg out lvg pgnd diag vboot q3 gp7nb60hdfp c3 .1uf r4 100 r8 100 r10 68k 270 r11 r3 100 hi1 li1 hi2 li2 hi3 li3 hi1 li1 hi2 li2 hi3 li3 printed resistor see pcb *
AN1291 - application note 10/33 3.2 closed loop fuzzy control in the following figure is shown the complete schematic of the digital control with st52x420. to generate the six signals to be sent to the inverter section, st52x420 uses the three-pwm peripheral. figure 13. scheme diagram for signal generation with st52x420 these three signals are used from the dead time net in order to obtain all the six signals for the inverter stage to avoid cross conduction in the power switch of each leg. +15 +15 vcc vcc vcc vcc c10 1nf c15 1nf u4 ts831 21 3 in out gn d c22 0.1uf c23 0.1uf 1 u2f 74hc14 13 12 c16 1nf r7 3.3k d6 1n4148 c13 0.1uf c1 0.1uf c14 0.1uf ~ ~ + - v1 0.5a 50v 1 u2a 74hc14 12 1 u2e 74hc14 11 10 1 u2b 74hc14 34 1 u2c 74hc14 56 1 u2d 74hc14 98 d1 1n4148 r1 3.3k c4 1nf 1 u3a 7404 12 1 u3b 7404 34 1 u3d 7404 98 ~ ~ + - v2 2a500v 1 u3c 7404 56 j2 con8 1 2 3 4 5 6 7 8 j5 bus+ 1 t2 transformer 1:2 j6 bus- 1 r2 10k r8 220k d2 1n4148 c5 1nf c6 100pf 1 u3f 7404 13 12 1 u3e 7404 11 10 c3 0.1uf j3 220vac 1 2 j1 12 header 1 2 3 4 5 6 7 8 9 10 11 12 f1 1a u7 lm78l05acz 31 2 vin vout gnd + c21 68uf450v + c20 470uf16v + c19 1000uf25v d3 1n4148 c9 1nf r4 3.3k c2 0.1uf u1 st52x420 25 24 23 22 21 20 19 18 9 10 11 12 15 16 17 23 4 1 26 28 13 27 14 5 6 7 8 pa0/t0res pa1/t0outn pa2/t1outn pa3/t2outn pa4/t0strt pa5/t0clk pa6 pa7/ain7 pb0/ain0 pb1/ain1 pb2/ain2 pb3/ain3 pb4/ain4 pb5/ain5 pb6/ain6 oscout oscin test reset vpp vdd vdda vss gnda pc0/int pc1/t0out pc2/t1out pc3/t2out r3 3.3k y1 20mhz c8 22pf c7 22pf r5 3.3k d5 1n4148 d4 1n4148 r6 3.3k
11/33 AN1291 - application note figure 14. components layout of the three-phase inverter figure 15. three-phase inverter board (power section)
AN1291 - application note 12/33 figure 16. control board with st52x420 ab420_4 st52x420
13/33 AN1291 - application note figure 17. control board (st52x420)
AN1291 - application note 14/33 4. software description before to analyze the structure of the software project, it is necessary to notice some connections on the schematic. the pins 6, 7 and 8 of st52x420, (outputs of the three pwm peripherals), are used to drive the three legs of the bridge. the three-phase voltage is obtained by indexing 3 pointers on the same look-up-table containing the de- sired pwm pattern at modulation index equal to 1, to reconstruct a sinusoidal signal. this pattern is recomputed every time for each modulation index, in order to obtain three pwm signals. one single pointer is shifted on this table, synchronously with one pwm pointer, in order to obtain three phases supplied with 120 o phase shift. sine period is instead defined by the number n of adc interrupts: statoric period = ad_int_counter*ad_int_period*number_of_samples=n*16 m s*24. in fact, the ad peripheral of st52x420, besides reading from the pin 9 (ain0/pb0) the value of reference for the motor speed, is used as time measurer, exploiting the fact that the peripheral requires an interrupt every time that a conversion has been completed (see also paragraph 4). finally pin 5, configured as ex- ternal interrupt, is used to measure the instantaneous motor speed by means of a tachometer. 4.1 main program the main program is shown in the following flowchart: figure 18. flowchart : variables and peripherals initialisation start rotation period is completed wait for interr upt r ead look_up_table and c alculate duty_cycle no yes calcu late error frequency frequenc y fuzzy c ontrol calcu late slip slip fuzzy c ontrol a/d interrupt routin e set stator frequency reti external interrupt routin e start/stop rotor frequency c alculation reti pwm_0 interrupt routine rotor frequency calcu lation reti main
15/33 AN1291 - application note in the following figure is shown the main program in fuzzystudio tm 4 environment. the appendix at the end of this application note contains the whole assembler code generated by the compiler. figure 19. main program window 4.2 'initialize' folder the folder 'initialize' contains the blocks used to initialize the global variables and the interrupts mask, and to start the peripherals adc, pwm0, pwm1 and pwm2. figure 20. variables and peripherals initialization
AN1291 - application note 16/33 4. 3 'ad interrupt' routine the ad interrupt is used as counter; in fact, each 16 m s an interrupt is generated and the counter 'ad_int_counter' is incremented. the period between two interrupts is given by the formula: tconv=number_of_channels*[78*sck+4]*tckm when 'sck' is 2 or 1 if ad frequency is divided by 2 or not, and tckm is the period of the clock master. in the case described, when the number of channels converted are 2 (0 and 1) and the ad frequency is the clock master frequency (20 mhz) divided by 2, tconv=2*[78*2+4]*50 ns= 16 m s. figure 21. a/d interrupt routine when the counter 'ad_int_counter' reaches the value 'fstator', the pointers are incremented in order to read on the look-up-table the new sample value of the sine wave (see read_table folder paragraph), and 'ad_int_counter' is first put to 255, so that, when increased, it is reset. 4.4 'external interrupt' and 'pwm0 interrupt' routines the external interrupt is used to measure the rotor period; in fact it is measured by counting the time be- tween two positive edges of the square wave supplied by a tachometer system, that is connected to the int pin; a variable named 'flag' is used to select the edge. if the variable value is 0, the pwm0_int is en- abled, in order to start the calculation of a period, and the variable 'flag' is set to 1. at the next external interrupt the pwm0_int is disabled and the value reached from the variable 'fr_measure' is a measure of the rotor period. moreover, the variable 'flag' is set to 0, in order to restart the calculation at the following edge and the vari- able 'flag_fuzzy' is set to 1, in order to perform the fuzzy control (see fig. 23).
17/33 AN1291 - application note figure 22. external interrupt routine of course the variable 'fr_measure' is incremented in the 'pwm0_int' routine, and the value obtained be- tween two external interrupt edges must be compared with the value of the stator frequency. in fact the stator period is: tstator=fstator*16 m s*24=(384*fstator) m s, instead the rotor period measured with a tacho that gets a period 1/8 of the rotor period is: trotor=fr_measure*102 m s*8=(816*fr_measure) m s. you have to notice that the value 102 ls is the period of pwm0, corresponding at a frequency value of 9.8 khz, as you can see in figure 5 in the 'working frequency' box. in order to make consistent the measure of rotor frequency with that of the stator, you have to use another variable 'frotor' so that: frotor=(816/384)*fr_measure=(17/8)*fr_measure
AN1291 - application note 18/33 figure 23. pwm 4.5 'read_table' folder the block a read_table o is used to obtain three pwm signals; each of the three instantaneous duty-cycle values are generated addressing three pointers, (called ' sina_phase , sinb_phase , sinc_phase o) in the look-up-table where unitary and sampled sinewave are stored. the voltage amplitude of the sinewave is obtained by using the multiplication and division capabilities of st52x420, as you can see in the figures 24 and 25. in the block a read_table0 o the instruction atable_value=sinus[sina_phase]o allows to access the look-up- table 'sinus' and store the value addressed from the index a sina_phase o in the variable a table_value o. then the subroutine 'voltage' is called, in order to calculate the duty-cycle in accordance with the modu- lation index; this procedure is performed three times, for each duty-cycle value, that will be charged in the respective pwm_count with the block a pwm_count_set o. in the block a duty_cycle_calculator o the module of the value read from the look-up-table is multiplied by the value a voltage_level o, (obtained from fuzzy block a slip_control o) and divided by a level_number o, in or- der to obtain the instantaneous duty-cycle. moreover, the block a reset_cursor o is used to control if the val- ues of the indexes reached the maximum, in order to reset them if that happened.
19/33 AN1291 - application note figure 24. read table folder figure 25. voltage 4.6 fuzzy controls two fuzzy blocks are present in this program: the first is used to control the frequency, the second to con- trol the slip. the block a error_calculator o performs the instruction 'error=reference-frotor'; a reference o is the value de- sired for the motor speed, that can be varied with a trimmer, in the range '1/(16e-6*24*240)= 10.8hz -- 1/ (16e-6*24*40)=65.1hz', instead a frotor o is the frequency measured with the tachometer.
AN1291 - application note 20/33 before sending the a error o value to the fuzzy input, a control to avoid an overflow or underflow is per- formed. in according with the input value, the fuzzy block a frequency_control o produces the incremental value adfstatoro, that is added (with sign), in the block a frequency_calculator o, to the current value of the variable a fstator o. in this way, the speed motor is adjusted to reach the reference value. figure 26. frequency control the block a slip_calculator o is used to calculate the slip, as 'slip=fstator-frotor', with a control to avoid an overflow or underflow. according with the a slip o value and the statoric frequency, the fuzzy block a slip_control o calculates the val- ue of the modulation index a voltage_level o, that allows to adjust the voltage level of the sinusoidal phases. the memberships and the fuzzy rules of this block represent the mathematical model of the motor and were obtained through experiments with different points of operation. figure 27. slip calculation
21/33 AN1291 - application note appendix a - assembler code ; interrupt vector configuration irq 4 external irq 0 ad_converter irq 1 pwmtimer0 irq 2 pwmtimer1 irq 3 pwmtimer2 ; global mbf definition mbf 0 45 195 45 mbf 1 6 128 8 mbf 2 45 240 0 mbf 3 0 98 24 mbf 4 45 105 45 mbf 5 17 113 13 mbf 6 24 122 6 mbf 7 0 96 17 mbf 8 5 140 0 mbf 9 17 160 0 mbf 10 15 128 15 mbf 11 0 60 45 mbf 12 7 135 5 mbf 13 45 150 45 mbf 14 13 143 17 ; tables allocation ; obyte sinus[24]o use 24 eprom locations from 63(page:0 offset:63) to 86(page:0 offset:86) data 0 63 0 ; sinus[0] = 0 data 0 64 33 ; sinus[1] = 33 data 0 65 63 ; sinus[2] = 63 data 0 66 90 ; sinus[3] = 90 data 0 67 110 ; sinus[4] = 110 data 0 68 123 ; sinus[5] = 123 data 0 69 127 ; sinus[6] = 127 data 0 70 123 ; sinus[7] = 123 data 0 71 110 ; sinus[8] = 110 data 0 72 90 ; sinus[9] = 90 data 0 73 63 ; sinus[10] = 63 data 0 74 33 ; sinus[11] = 33 data 0 75 128 ; sinus[12] = 128 data 0 76 161 ; sinus[13] = 161 data 0 77 191 ; sinus[14] = 191 data 0 78 218 ; sinus[15] = 218 data 0 79 238 ; sinus[16] = 238 data 0 80 251 ; sinus[17] = 251 data 0 81 255 ; sinus[18] = 255 data 0 82 251 ; sinus[19] = 251 data 0 83 238 ; sinus[20] = 238 data 0 84 218 ; sinus[21] = 218 data 0 85 191 ; sinus[22] = 191 data 0 86 161 ; sinus[23] = 161 ; tables allocation report: ; byte used : 24 ; from : 63(page:0 offset:63) ; to : 86(page:0 offset:86) setmem 0 87
AN1291 - application note 22/33 ; store device configuration parameters into eprom ; default interrupt priority data 0 87 228 ; port configuration data 0 90 0 data 0 98 248 data 0 99 243 data 0 100 3 data 0 101 241 data 0 102 0 ; a/d converter configuration data 0 89 58 ; watchdog configuration data 0 88 12 ; pwm-timer 0 configuration data 0 91 208 data 0 92 35 data 0 93 0 ; pwm-timer 1 configuration data 0 94 208 data 0 95 35 ; pwm-timer 2 configuration data 0 96 208 data 0 97 35 setmem 0 103 ; end ************************************ ; set device configuration parameters pgset 0 ldce 1 87 ldce 2 88 ldce 3 89 ldce 4 90 ldce 5 91 ldce 6 92 ldce 7 93 ldce 8 94 ldce 9 95 ldce 10 96 ldce 11 97 ldce 12 98 ldce 13 99 ldce 14 100 ldce 15 101 ldce 16 102 ldrc 0 0 ldpr 4 0 ldpr 6 0 ldpr 8 0 ; ** user defined variables ** ; name -> reg
23/33 AN1291 - application note ; ------------------------------------------ ; ad_int_counter -> 10 ; fr_measure -> 11 ; frotor -> 12 ; fstator -> 13 ; dfstator -> 14 ; duty -> 15 ; duty0 -> 16 ; duty1 -> 17 ; duty2 -> 18 ; error -> 19 ; flag -> 20 ; flag_fuzzy -> 21 ; level_number -> 22 ; reference -> 23 ; sina_phase -> 24 ; sinb_phase -> 25 ; sinc_phase -> 26 ; slip -> 27 ; table_value -> 28 ; temp -> 29 ; voltage_level -> 30 ; word1 -> 31 32 ; word_value -> 33 34 ; ********************************** main: ; ********** start procedures omaino start: initialize: init_var: ldrc 20 0 ldrc 21 0 ldrc 24 0 ldrc 25 8 ldrc 26 16 ldrc 22 128 ldrc 30 64 ldrc 23 200 ldrc 13 200 ldrc 27 248 ldrc 10 0 enable_int: ; irqenablemask mdgi ldrc 0 3 ldcr 0 0 megi adc_start: ; adc setting mdgi ldrc 0 63 ldcr 3 0 megi three_pwm_start: ; all_pwm setting
AN1291 - application note 24/33 mdgi ldrc 0 224 ldcr 7 0 ldrc 0 213 ldcr 5 0 ldrc 0 213 ldcr 8 0 ldrc 0 213 ldcr 10 0 ldrc 0 0 ldcr 7 0 megi exit0: jp initialize_exit initialize_exit: flag_fuzzy: mdgi ldrc 0 1 sub 0 21 megi jpnz end_if_6 jp read_table end_if_6: no_operation: jp flag_fuzzy read_table: read_table0: mdgi ldrr 0 24 ldrc 28 63 add 28 0 pgset 0 read: ldrc 0 28 ldre (0) (28) megi call3: call voltage duty0: ldrr 16 15 read_table1: mdgi ldrr 0 25 ldrc 28 63 add 28 0 pgset 0 read_1: ldrc 0 28 ldre (0) (28) megi
25/33 AN1291 - application note call4: call voltage duty1: ldrr 17 15 read_table2: mdgi ldrr 0 26 ldrc 28 63 add 28 0 pgset 0 read_2: ldrc 0 28 ldre (0) (28) megi call5: call voltage duty2: ldrr 18 15 pwm_count_set: ldpr 3 16 ldpr 5 17 ldpr 7 18 reset_cursor: mdgi ldrc 0 24 sub 0 24 megi jpnz no_if_9 ldrc 24 0 jp end_if_9 no_if_9: mdgi ldrc 0 24 sub 0 25 megi jpnz no_if_8 ldrc 25 0 jp end_if_8 no_if_8: mdgi ldrc 0 24 sub 0 26 megi jpnz end_if_7 ldrc 26 0 end_if_7: end_if_8: end_if_9: exit6: jp read_table_exit
AN1291 - application note 26/33 read_table_exit: error_calculator: ldri 23 1 mdgi ldrc 0 240 sub 0 23 megi jpns no_if_11 ldrc 23 240 jp end_if_11 no_if_11: mdgi ldrc 0 40 ldrr 1 23 sub 1 0 megi jpns end_if_10 ldrc 23 40 end_if_10: end_if_11: mdgi ldrr 19 23 subo 19 12 megi jpnc no_if_13 ldrc 19 255 jp end_if_13 no_if_13: jpns end_if_12 ldrc 19 0 end_if_12: end_if_13: frequency_control: ; fuzzy system : frequency_control mdgi ; init error ldfr 0 19 ; output variable : dfstaror fuzzy ldp 0 7 ldp 0 7 fzand con 118 ldp 0 5 ldp 0 5 fzand con 124 ldp 0 10 ldp 0 10 fzand con 128 ldp 0 14
27/33 AN1291 - application note ldp 0 14 fzand con 132 ldp 0 9 ldp 0 9 fzand con 138 out 14 megi ; ; end fuzzy system : frequency_control frequency_calculator: mdgi addo 13 14 megi mdgi ldrc 0 240 sub 0 13 megi jpns no_if_15 ldrc 13 240 jp end_if_15 no_if_15: mdgi ldrc 0 40 ldrr 1 13 sub 1 0 megi jpns end_if_14 ldrc 13 40 end_if_14: end_if_15: slip_calculator: mdgi ldrr 27 13 subo 27 12 megi jpnc no_if_17 ldrc 27 255 jp end_if_17 no_if_17: jpns end_if_16 ldrc 27 0 end_if_16: end_if_17: ldrc 21 0 slip_control: ; fuzzy system : slip_control mdgi ; init slip ldfr 0 27 ; init fstator
AN1291 - application note 28/33 ldfr 1 13 ; output variable : voltage_level fuzzy ldp 1 11 ldp 0 3 fzand con 124 ldp 1 11 ldp 0 6 fzand con 116 ldp 1 11 ldp 0 1 fzand con 108 ldp 1 11 ldp 0 12 fzand con 100 ldp 1 11 ldp 0 8 fzand con 92 ldp 1 4 ldp 0 3 fzand con 108 ldp 1 4 ldp 0 6 fzand con 100 ldp 1 4 ldp 0 1 fzand con 92 ldp 1 4 ldp 0 12 fzand con 84 ldp 1 4 ldp 0 8 fzand con 76 ldp 1 13 ldp 0 3 fzand con 92 ldp 1 13 ldp 0 6 fzand con 84 ldp 1 13 ldp 0 1 fzand con 76 ldp 1 13 ldp 0 12 fzand con 68 ldp 1 13 ldp 0 8 fzand
29/33 AN1291 - application note con 60 ldp 1 0 ldp 0 3 fzand con 76 ldp 1 0 ldp 0 6 fzand con 68 ldp 1 0 ldp 0 1 fzand con 60 ldp 1 0 ldp 0 12 fzand con 52 ldp 1 0 ldp 0 8 fzand con 44 ldp 1 2 ldp 0 3 fzand con 60 ldp 1 2 ldp 0 6 fzand con 52 ldp 1 2 ldp 0 1 fzand con 44 ldp 1 2 ldp 0 12 fzand con 36 ldp 1 2 ldp 0 8 fzand con 28 out 30 megi ; ; end fuzzy system : slip_control jp no_operation ; ; end procedures omaino ***** ad_converter: ; ** start procedures oad_convertero set_sinus_frequency: mdgi ldrr 0 10 sub 0 13 megi jpnz end_if mdgi inc 24 megi mdgi
AN1291 - application note 30/33 inc 25 megi mdgi inc 26 megi ldrc 10 255 end_if: mdgi inc 10 megi reti2: reti ; ; end procedures oad_convertero ***** pwmtimer0: ; ****** start procedures opwmtimer0o inc_fr_measure: mdgi inc 11 megi reti1: reti ; ; end procedures opwmtimer0o ****** pwmtimer1: ;****** start procedures opwmtimer1o reti ; ; end procedures opwmtimer1o******* pwmtimer2: ;****** start procedures opwmtimer2o reti ; ; end procedures opwmtimer2o******** external: ; ******* start procedures oexternalo watchdog_0: ; wdt setting wdtrfr jump0: mdgi ldrc 0 0 sub 0 20 megi jpnz end_if_1 jp enable_tim0_int end_if_1:
31/33 AN1291 - application note disable_tim0_int: ; irqenablemask mdgi ldrc 0 3 ldcr 0 0 megi fr_calculator: ldrc 20 0 ldrc 21 1 mdgi ldrc 0 120 sub 0 11 megi jpns end_if_2 ldrc 11 120 end_if_2: ldrc 29 8 mdgi ldrc 31 17 mult 31 11 megi mdgi ldrr 0 31 ldrr 1 32 div 0 29 ldrr 12 1 megi reti0: reti enable_tim0_int: ; irqenablemask mdgi ldrc 0 7 ldcr 0 0 megi reset_fr_measure: ldrc 11 0 ldrc 20 1 jp reti0 ; ; end procedures oexternalo ********* voltage: ; ******* start procedures ovoltageo duty_cycle_calculator: mdgi ldrc 0 128 ldrr 1 28 sub 1 0 megi jps no_if_5 mdgi ldrc 0 127 and 28 0 megi mdgi ldrr 33 28
AN1291 - application note 32/33 mult 33 30 megi mdgi ldrr 0 33 ldrr 1 34 div 0 22 ldrr 15 1 megi mdgi ldrc 0 127 ldrr 1 15 sub 1 0 megi jpns no_if_3 mdgi ldrc 0 127 sub 0 15 ldrr 15 0 megi jp end_if_3 no_if_3: ldrc 15 0 end_if_3: jp end_if_5 no_if_5: mdgi ldrr 33 28 mult 33 30 megi mdgi ldrr 0 33 ldrr 1 34 div 0 22 ldrr 15 1 megi mdgi ldrc 0 128 ldrr 1 15 sub 1 0 megi jpns no_if_4 mdgi ldrc 0 128 add 15 0 megi jp end_if_4 no_if_4: ldrc 15 255 end_if_4: end_if_5: return0: ret ; ; end procedures ovoltageo ************
33/33 AN1291 - application note information furnished is believed to be accurate and reliable. however, stmicroelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. no license is granted by implication or otherwise under any patent or patent rights of stmicroelectronics. specification mentioned in this publication are subject to change without notice. this publication supersedes and replaces all information previously supplied. stmicroelectronics products are not authorized for use as critical components in life support devices or systems without express written approval of stmicroelectronics. the st logo is a trademark of stmicroelectronics ? 2000 stmicroelectronics - all rights reserved fuzzystudio tm is a registered trademark of stmicroelectronics stmicroelectronics group of companies http://www.st.com australia - brazil - china - finland - france - germany - hong kong - india - italy - japan - malaysia - malta - morocco- singapore - spain - sweden - switzerland - united kingdom - u.s.a.


▲Up To Search▲   

 
Price & Availability of AN1291

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X